
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>LammpsIO module &#8212; LammpsIO 1.0 documentation</title>
    <link rel="stylesheet" href="_static/classic.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    
    <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
    
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" /> 
  </head><body>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="nav-item nav-item-0"><a href="index.html">LammpsIO 1.0 documentation</a> &#187;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <div class="section" id="module-LammpsIO">
<span id="lammpsio-module"></span><h1>LammpsIO module<a class="headerlink" href="#module-LammpsIO" title="Permalink to this headline">¶</a></h1>
<p>LammpsIO
Created on 21 September 2018
&#64;author: Robert Ivancic</p>
<p>This module was created to facilitate input and output of LAMMPS
trajectory files in dump and netCDF (AMBER) format.</p>
<p class="rubric">Notes</p>
<p>We plan to add a log reading functionality to this module soon.</p>
<dl class="class">
<dt id="LammpsIO.DumpIO">
<em class="property">class </em><code class="descclassname">LammpsIO.</code><code class="descname">DumpIO</code><a class="reference internal" href="_modules/LammpsIO.html#DumpIO"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#LammpsIO.DumpIO" title="Permalink to this definition">¶</a></dt>
<dd><p>Input and output LAMMPS trajectories in dump (lammpstrj) format.</p>
<p>This class inputs and outputs frames of a LAMMPS trajectory. It does
this <em>sequentially</em>, i.e. it reads (writes) in a single frame of a dump
(lammpstrj) trajectory at a time starting at frame 0. This approach has
two benefits to reading in an entire trajectory at once both steming
from the fact that it is more memory efficient. First (and most
importantly), python has memory limits that are easily reached if
the number of particles times the number of frames loaded in at one
time is greater than 25,000,000. Practically, it is very easy to hit
this limit when running large or long time simulations. Second,
this approach is generally faster than loading in all frames at once
as it requires much less time to allocate memory.</p>
<dl class="method">
<dt id="LammpsIO.DumpIO.CloseI">
<code class="descname">CloseI</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/LammpsIO.html#DumpIO.CloseI"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#LammpsIO.DumpIO.CloseI" title="Permalink to this definition">¶</a></dt>
<dd><p>Closes input (reading) dump file.</p>
</dd></dl>

<dl class="method">
<dt id="LammpsIO.DumpIO.CloseO">
<code class="descname">CloseO</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/LammpsIO.html#DumpIO.CloseO"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#LammpsIO.DumpIO.CloseO" title="Permalink to this definition">¶</a></dt>
<dd><p>Closes output file for dump</p>
</dd></dl>

<dl class="method">
<dt id="LammpsIO.DumpIO.GetBB">
<code class="descname">GetBB</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/LammpsIO.html#DumpIO.GetBB"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#LammpsIO.DumpIO.GetBB" title="Permalink to this definition">¶</a></dt>
<dd><p>Gets box boundary (BB) of current frame. These are formatted as
[low_x, high_x] for each dimension.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><strong>bb_t</strong> – box boundaries of current frame</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">numpy array (dimension,2)</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="LammpsIO.DumpIO.GetDataCol">
<code class="descname">GetDataCol</code><span class="sig-paren">(</span><em>label</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/LammpsIO.html#DumpIO.GetDataCol"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#LammpsIO.DumpIO.GetDataCol" title="Permalink to this definition">¶</a></dt>
<dd><p>Gets data column of current frame</p>
<p>A data column is a way of storing values that are associated with
every particle in a simulation or experiment at every timestep.
Examples include: J2, D2min, p_{hop}, or softness of every
particle at every timestep. This gets a data column for the current
frame in the dump file.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>label</strong> (<em>str</em>) – name of data column label</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><strong>id_t</strong> – particle ids of each particle of current frame</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">numpy array (number of particles,)</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="LammpsIO.DumpIO.GetID">
<code class="descname">GetID</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/LammpsIO.html#DumpIO.GetID"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#LammpsIO.DumpIO.GetID" title="Permalink to this definition">¶</a></dt>
<dd><p>Gets particle ids of current frame</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><strong>id_t</strong> – particle ids of each particle of current frame</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">numpy array (number of particles,)</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="LammpsIO.DumpIO.GetPos">
<code class="descname">GetPos</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/LammpsIO.html#DumpIO.GetPos"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#LammpsIO.DumpIO.GetPos" title="Permalink to this definition">¶</a></dt>
<dd><p>Gets particle positions (coordinates) of current frame</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><strong>pos_t</strong> – particle positions (coordinates) of each particle of current
frame</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">numpy array (number of particles, dimension)</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="LammpsIO.DumpIO.Gett">
<code class="descname">Gett</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/LammpsIO.html#DumpIO.Gett"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#LammpsIO.DumpIO.Gett" title="Permalink to this definition">¶</a></dt>
<dd><p>Gets timestep t of current frame.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><strong>t</strong> – timestep of the current frame.</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">int</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="LammpsIO.DumpIO.LoadNextFrame">
<code class="descname">LoadNextFrame</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/LammpsIO.html#DumpIO.LoadNextFrame"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#LammpsIO.DumpIO.LoadNextFrame" title="Permalink to this definition">¶</a></dt>
<dd><p>Loads next frame in the dump (lammpstrj) file.</p>
<p>Reads all timestep, box boundary, particle id, particle position,
and data column information given in frame to file. Must use OpenI
before use. Get functions may be used after this function.</p>
</dd></dl>

<dl class="method">
<dt id="LammpsIO.DumpIO.NumDims">
<code class="descname">NumDims</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/LammpsIO.html#DumpIO.NumDims"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#LammpsIO.DumpIO.NumDims" title="Permalink to this definition">¶</a></dt>
<dd><p>Outputs number of dimensions of current simulation being read.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><strong>d</strong> – Number of dimensions of simulation you are reading.</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">int</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="LammpsIO.DumpIO.NumFrames">
<code class="descname">NumFrames</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/LammpsIO.html#DumpIO.NumFrames"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#LammpsIO.DumpIO.NumFrames" title="Permalink to this definition">¶</a></dt>
<dd><p>Outputs number of frames of current simulation being read.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><strong>n_f</strong> – Number of frames of the simulation you are reading.</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">int</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="LammpsIO.DumpIO.NumPartsCurrentf">
<code class="descname">NumPartsCurrentf</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/LammpsIO.html#DumpIO.NumPartsCurrentf"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#LammpsIO.DumpIO.NumPartsCurrentf" title="Permalink to this definition">¶</a></dt>
<dd><p>Outputs number of particles in current frame.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><strong>n_p</strong> – Number of particles in the current frame.</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">int</td>
</tr>
</tbody>
</table>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">If used without loading any frames, gives number of particles of
first frame.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="LammpsIO.DumpIO.OpenI">
<code class="descname">OpenI</code><span class="sig-paren">(</span><em>dump_file_name</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/LammpsIO.html#DumpIO.OpenI"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#LammpsIO.DumpIO.OpenI" title="Permalink to this definition">¶</a></dt>
<dd><p>Opens lammpstrj file for input</p>
<p>Opens a dump (lammpstrj) file of name dump_file_name for reading
(input)</p>
</dd></dl>

<dl class="method">
<dt id="LammpsIO.DumpIO.OpenO">
<code class="descname">OpenO</code><span class="sig-paren">(</span><em>dump_file_name</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/LammpsIO.html#DumpIO.OpenO"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#LammpsIO.DumpIO.OpenO" title="Permalink to this definition">¶</a></dt>
<dd><p>Opens dump file for output.</p>
<p>Opens a dump (lammpstrj) file of name dumpe_file_name for writing
(output).</p>
</dd></dl>

<dl class="method">
<dt id="LammpsIO.DumpIO.SetBB">
<code class="descname">SetBB</code><span class="sig-paren">(</span><em>bb_t</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/LammpsIO.html#DumpIO.SetBB"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#LammpsIO.DumpIO.SetBB" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets box boundaries (BB) of current frame</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>bb_t</strong> (<em>numpy array</em><em> (</em><em>dimension</em><em>,</em><em>2</em><em>)</em>) – box boundaries of current frame</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="LammpsIO.DumpIO.SetDataCol">
<code class="descname">SetDataCol</code><span class="sig-paren">(</span><em>label</em>, <em>data_col_t</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/LammpsIO.html#DumpIO.SetDataCol"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#LammpsIO.DumpIO.SetDataCol" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets particle positions of current frame</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>label</strong> (<em>str</em>) – name of the data column</li>
<li><strong>data_col_t</strong> (<em>numpy array</em><em> (</em><em>number of particles</em><em>,</em><em>)</em>) – particle positions (coordinates) of current frame in order of
id_t</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="LammpsIO.DumpIO.SetID">
<code class="descname">SetID</code><span class="sig-paren">(</span><em>id_t</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/LammpsIO.html#DumpIO.SetID"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#LammpsIO.DumpIO.SetID" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets particle ids of current frame</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>id_t</strong> (<em>numpy array</em><em> (</em><em>number of particles</em><em>,</em><em>)</em>) – particle ids of each particle of current frame</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="LammpsIO.DumpIO.SetPos">
<code class="descname">SetPos</code><span class="sig-paren">(</span><em>pos_t</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/LammpsIO.html#DumpIO.SetPos"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#LammpsIO.DumpIO.SetPos" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets particle positions of current frame</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>pos_t</strong> (<em>numpy array</em><em> (</em><em>number of particles</em><em>, </em><em>dimensions</em><em>)</em>) – particle positions (coordinates) of current frame in order of
id_t</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="LammpsIO.DumpIO.Sett">
<code class="descname">Sett</code><span class="sig-paren">(</span><em>t</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/LammpsIO.html#DumpIO.Sett"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#LammpsIO.DumpIO.Sett" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets timestep t of current frame</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>t</strong> (<em>int</em>) – timestep of current frame</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="LammpsIO.DumpIO.SortByID">
<code class="descname">SortByID</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/LammpsIO.html#DumpIO.SortByID"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#LammpsIO.DumpIO.SortByID" title="Permalink to this definition">¶</a></dt>
<dd><p>Sorts particles of all arrays by their id</p>
<p>Sorts pos_t, id_t, and data_col_t arrays so that
id_t = range(n_p)</p>
</dd></dl>

<dl class="method">
<dt id="LammpsIO.DumpIO.WriteNextFrame">
<code class="descname">WriteNextFrame</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/LammpsIO.html#DumpIO.WriteNextFrame"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#LammpsIO.DumpIO.WriteNextFrame" title="Permalink to this definition">¶</a></dt>
<dd><p>Writes the next frame to the dump file.</p>
<p>Writes all timestep, box boundary, particle id, particle position,
and data column information given in frame to file. Must use OpenO
and Set functions before use.</p>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">Will run without having set particle ids. Assumes particles in order
from 1,…,(number of particles).</p>
</div>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="LammpsIO.NetCDFIO">
<em class="property">class </em><code class="descclassname">LammpsIO.</code><code class="descname">NetCDFIO</code><a class="reference internal" href="_modules/LammpsIO.html#NetCDFIO"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#LammpsIO.NetCDFIO" title="Permalink to this definition">¶</a></dt>
<dd><p>Input and output of LAMMPS trajectories in NetCDF (AMBER).</p>
<p>This class inputs and outputs individual frames from an AMBER
format molecular dynamics trajectory. More on AMBER can be found
here: <a class="reference external" href="http://ambermd.org/netcdf/nctraj.xhtml">http://ambermd.org/netcdf/nctraj.xhtml</a>. More on NetCDF can
be found here: <a class="reference external" href="https://en.wikipedia.org/wiki/NetCDF">https://en.wikipedia.org/wiki/NetCDF</a>. There are two
major advantages to this output format over standard dump files.
First, these files are in binary format and thus, use about 1/3 of
the space of standard dump files. Second, reading standard dump files
must be done sequentially. With NetCDF you may obtain data from any
frame of interest <em>f</em> instantly by simply selecting that frame in the
data array. The major disadvantage of this format is that it assumes
a constant number of particles throughout a simulation or experiment.
Particles are assumed to be ordered by their ids.</p>
<dl class="method">
<dt id="LammpsIO.NetCDFIO.CloseI">
<code class="descname">CloseI</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/LammpsIO.html#NetCDFIO.CloseI"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#LammpsIO.NetCDFIO.CloseI" title="Permalink to this definition">¶</a></dt>
<dd><p>Closes input NetCDF file</p>
</dd></dl>

<dl class="method">
<dt id="LammpsIO.NetCDFIO.CloseO">
<code class="descname">CloseO</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/LammpsIO.html#NetCDFIO.CloseO"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#LammpsIO.NetCDFIO.CloseO" title="Permalink to this definition">¶</a></dt>
<dd><p>Closes output NetCDF file</p>
</dd></dl>

<dl class="method">
<dt id="LammpsIO.NetCDFIO.GetBB">
<code class="descname">GetBB</code><span class="sig-paren">(</span><em>f</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/LammpsIO.html#NetCDFIO.GetBB"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#LammpsIO.NetCDFIO.GetBB" title="Permalink to this definition">¶</a></dt>
<dd><p>Gets box boundaries (BB) of frame f. These are formatted as
[low_x, high_x] for each dimension.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>f</strong> (<em>int</em>) – frame number</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><strong>bb_t</strong> – box boundaries at time t</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">numpy array (dimension,2)</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="LammpsIO.NetCDFIO.GetDataCol">
<code class="descname">GetDataCol</code><span class="sig-paren">(</span><em>f</em>, <em>label</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/LammpsIO.html#NetCDFIO.GetDataCol"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#LammpsIO.NetCDFIO.GetDataCol" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets a data column at frame f</p>
<p>A data column is a way of storing values that are associated with
every particle in a simulation or experiment at every timestep.
Examples include: J2, D2min, p_{hop}, or softness of every particle
at every timestep. This gets a data column for time t.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>f</strong> (<em>int</em>) – frame number</li>
<li><strong>label</strong> (<em>str</em>) – data column name</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>data_col_t</strong> – data column values for all particles at frame f</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">numpy array (number of particles,)</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="LammpsIO.NetCDFIO.GetPos">
<code class="descname">GetPos</code><span class="sig-paren">(</span><em>f</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/LammpsIO.html#NetCDFIO.GetPos"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#LammpsIO.NetCDFIO.GetPos" title="Permalink to this definition">¶</a></dt>
<dd><p>Gets particle positions (coordinates) at frame f</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>f</strong> (<em>int</em>) – frame number</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><strong>pos_t</strong> – particle positions (coordinates) at frame f</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">numpy array (number of particles, dimension)</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="LammpsIO.NetCDFIO.Gett">
<code class="descname">Gett</code><span class="sig-paren">(</span><em>f</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/LammpsIO.html#NetCDFIO.Gett"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#LammpsIO.NetCDFIO.Gett" title="Permalink to this definition">¶</a></dt>
<dd><p>Gets timestep t of frame f</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>f</strong> (<em>int</em>) – frame number</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><strong>t</strong></td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">int</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="LammpsIO.NetCDFIO.NumDims">
<code class="descname">NumDims</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/LammpsIO.html#NetCDFIO.NumDims"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#LammpsIO.NetCDFIO.NumDims" title="Permalink to this definition">¶</a></dt>
<dd><p>Outputs number of dimensions of current simulation being read.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><strong>d</strong> – Number of dimensions of simulation you are reading.</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">int</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="LammpsIO.NetCDFIO.NumFrames">
<code class="descname">NumFrames</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/LammpsIO.html#NetCDFIO.NumFrames"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#LammpsIO.NetCDFIO.NumFrames" title="Permalink to this definition">¶</a></dt>
<dd><p>Outputs number of frames of current simulation being read.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><strong>n_f</strong> – Number of frames of simulation you are reading.</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">int</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="LammpsIO.NetCDFIO.NumParts">
<code class="descname">NumParts</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/LammpsIO.html#NetCDFIO.NumParts"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#LammpsIO.NetCDFIO.NumParts" title="Permalink to this definition">¶</a></dt>
<dd><p>Outputs number of particles of current simulation being read.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><strong>n_p</strong> – Number of particles of simulation you are reading.</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">int</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="LammpsIO.NetCDFIO.OpenI">
<code class="descname">OpenI</code><span class="sig-paren">(</span><em>nc_file_name</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/LammpsIO.html#NetCDFIO.OpenI"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#LammpsIO.NetCDFIO.OpenI" title="Permalink to this definition">¶</a></dt>
<dd><p>Opens NetCDF file for input.</p>
<p>Opens a NetCDF file of nc_file_name for reading (input).</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>nc_file_name</strong> (<em>str</em>) – Name of netCDF file you wish to read from.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="LammpsIO.NetCDFIO.OpenO">
<code class="descname">OpenO</code><span class="sig-paren">(</span><em>nc_file_name</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/LammpsIO.html#NetCDFIO.OpenO"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#LammpsIO.NetCDFIO.OpenO" title="Permalink to this definition">¶</a></dt>
<dd><p>Opens NetCDF file for output.</p>
<p>Opens a NetCDF file of nc_file_name for writing (output).</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>nc_file_name</strong> (<em>str</em>) – Name of netCDF file you wish to write to.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="LammpsIO.NetCDFIO.SetBB">
<code class="descname">SetBB</code><span class="sig-paren">(</span><em>f</em>, <em>bb_t</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/LammpsIO.html#NetCDFIO.SetBB"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#LammpsIO.NetCDFIO.SetBB" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets box boundaries of frame f. These are formatted as
[low_x, high_x] for each dimension.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>f</strong> (<em>int</em>) – frame number</li>
<li><strong>bb_t</strong> (<em>numpy array</em><em> (</em><em>dimension</em><em>,</em><em>2</em><em>)</em>) – box boundaries at time t</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="LammpsIO.NetCDFIO.SetDataCol">
<code class="descname">SetDataCol</code><span class="sig-paren">(</span><em>f</em>, <em>label</em>, <em>data_col_t</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/LammpsIO.html#NetCDFIO.SetDataCol"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#LammpsIO.NetCDFIO.SetDataCol" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets a data column at frame f</p>
<p>A data column is a way of storing values that are associated with
every particle in a simulation or experiment at every timestep.
Examples include: J2, D2min, p_{hop}, or softness of every particle
at every timestep. This sets a data column for time t.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>f</strong> (<em>int</em>) – frame number</li>
<li><strong>label</strong> (<em>str</em>) – data column name</li>
<li><strong>data_col_t</strong> (<em>numpy array</em><em> (</em><em>number of particles</em><em>,</em><em>)</em>) – data column values for all particles at frame f</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="LammpsIO.NetCDFIO.SetPos">
<code class="descname">SetPos</code><span class="sig-paren">(</span><em>f</em>, <em>pos_t</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/LammpsIO.html#NetCDFIO.SetPos"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#LammpsIO.NetCDFIO.SetPos" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets particle positions (coordinates) at frame f</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>f</strong> (<em>int</em>) – frame number</li>
<li><strong>pos_t</strong> (<em>numpy array</em><em> (</em><em>number of particles</em><em>, </em><em>dimension</em><em>)</em>) – particle positions (coordinates) at frame f</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="LammpsIO.NetCDFIO.Sett">
<code class="descname">Sett</code><span class="sig-paren">(</span><em>f</em>, <em>t</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/LammpsIO.html#NetCDFIO.Sett"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#LammpsIO.NetCDFIO.Sett" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets timestep t of frame f</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>f</strong> (<em>int</em>) – frame number</li>
<li><strong>t</strong> (<em>int</em>) – timestep at frame f</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="indices-and-tables">
<h1>Indices and tables<a class="headerlink" href="#indices-and-tables" title="Permalink to this headline">¶</a></h1>
<ul class="simple">
<li><a class="reference internal" href="genindex.html"><span class="std std-ref">Index</span></a></li>
<li><a class="reference internal" href="py-modindex.html"><span class="std std-ref">Module Index</span></a></li>
<li><a class="reference internal" href="search.html"><span class="std std-ref">Search Page</span></a></li>
</ul>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
  <h3><a href="index.html">Table of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">LammpsIO module</a></li>
<li><a class="reference internal" href="#indices-and-tables">Indices and tables</a></li>
</ul>

  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="_sources/LammpsIO.rst.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
<div id="searchbox" style="display: none" role="search">
  <h3>Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    </div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="nav-item nav-item-0"><a href="index.html">LammpsIO 1.0 documentation</a> &#187;</li> 
      </ul>
    </div>
    <div class="footer" role="contentinfo">
        &#169; Copyright 2018, Robert J. S. Ivancic.
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.8.0.
    </div>
  </body>
</html>